package com.xbj.cloud.service.impl;

import com.xbj.cloud.db.dao.PayMapper;
import com.xbj.cloud.db.pojo.Pay;
import com.xbj.cloud.service.PayService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: 观雾
 * @create: 2024-07-16
 * @description:
 **/
@Service
public class PayServiceImpl implements PayService {
    @Resource
    private PayMapper payMapper;

    @Override
    public int add(Pay pay) {
        int count = payMapper.insertSelective(pay);
        return count;
    }

    @Override
    public int delete(Integer id) {
        int count = payMapper.deleteByPrimaryKey(id);
        return count;
    }

    @Override
    public int update(Pay pay) {
        int count = payMapper.updateByPrimaryKeySelective(pay);
        return count;
    }

    @Override
    public Pay getById(Integer id) {
        Pay pay = payMapper.selectByPrimaryKey(id);
        return pay;
    }

    @Override
    public List<Pay> getAll() {
        List<Pay> payList = payMapper.selectAll();
        return payList;
    }
}
